package com.xxx.reggie.mapper;


import com.xxx.reggie.entity.User;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Options;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Service;

public interface UserMapper {

    //根据手机号查询用户
    @Select("select * from user where phone=#{phone}")
    User UserByPhone(String phone);

    //新增用户(获取生成的主键)
    @Insert("insert into user(phone,status) value(#{phone},#{status})")
    @Options(useGeneratedKeys = true,keyColumn = "id",keyProperty = "id")
    Integer save(User user);
}
